/* 加班统计服务 */
import request from '@/utils/request';

export async function getMonthList(params) {
    return request('/api/oa/v1/attendancecount/overtimelist/getlist', {
        method: 'POST',
        data: params
    });
}

export async function getAllList(params) {
    return request('/api/oa/v1/attendancecount/overtimecount/getlist', {
        method: 'POST',
        data: params
    });
}

// 我的加班记录
export async function getMyovertime(params) {
    return request('/api/work/v1/attendance/overtime/web/getMyOvertime', {
        method: 'POST',
        data: params
    });
}

// 我的外出记录接口
export async function getMyout(params) {
    return request('/api/work/v1/attendance/out/getMyOut', {
        method: 'POST',
        data: params
    });
}

// 我的出差记录接口
export async function getMytrip(params) {
    return request('/api/work/v1/attendance/tripflow/getMyTrip', {
        method: 'POST',
        data: params
    });
}

// 打卡详情接口
export function getMyattenddetail(params) {
    return request('/api/work/v1/attendance/signdetail', {
        method: 'POST',
        data: params
    });
}

// 字典列表接口
export function getTypeList(params) {
    return request('/api/oa/v1/common/select/typelist', {
        method: 'POST',
        params
    });
}
/**
 * 补卡计算加班时间
 */
export async function getOverLong(params) {
    return request('/api/oa/v1/overtime/overLong', {
        method: 'POST',
        data: params
    });
}
/**
 * 查询公司所有员工
 */
export async function getemployeelist(params) {
    return request('/api/org/v1/employeeInfo/queryEmployeeDetailInfoList', {
        method: 'POST',
        data: params
    });
}
/**
 * 查询公司所有员工较少数据列表
 */
export async function getSimpleEmployeeList(params) {
    return request('/api/org/v1/employeeInfo/queryEmployeeInfoList', {
        method: 'POST',
        data: params
    });
}

/**
 * 查询查询业务负责人
 */
export async function getservicepersonlist(params) {
    return request('/api/oa/v1/employee/getservicepersonlist', {
        method: 'POST',
        data: params
    });
}
/**
 * 查询对应的员工
 * companyId: user.companyId,roleName: '招聘负责人' // TODO： 后面服务端会给字典
 */
export async function getemployeebyRole(params) {
    return request('/api/oa/v1/employee/getemployeebyrole', {
        method: 'POST',
        data: params
    });
}
/**
 * 查询招聘负责人
 * companyId Required
 * userName
 */
export async function getServicePersonlist(params) {
    return request('/api/oa/v1/employee/getservicepersonlist', {
        method: 'POST',
        data: params
    });
}
/**
 * 加班记录导出
 */
export async function attendExport(param) {
    return request('/api/oa/v1/attendancecountexport/getmyovertimeexport', {
        method: 'POST',
        data: param,
        getResponse: true,
        encryption: false,
        isFile: true,
        responseType: 'blob',
        headers: { 'Content-Type': 'application/json' }
    });
}
